<?php 
/*
	File: inc-addQuestionConfirmation.php
	
	This file sends data to the Java server to test the input/ouput files and gets a response back whether the data was correct.
	If the data is correct no Action is taken.  If the data is wrong it is removed from the database and the user is prompted to re upload the file
	
	 3 - completely successful
	 2 - compiles and runs but input does not match output
	 1 - Compiles but does not run
	 0 - Does not Compile
	 -1 - No question pair

*/
$page_name = "Add Question Confirmation";
$page_name = strtoupper($page_name);
echo "<span class='header-text'>Add Question Confirmation</span><br/>";
 


 //
$questionID = $_GET['questionID'];
$questionVersion = $_GET['questionVersion'];
//
$studentPairOne = $_GET['studentPairOne'];
$studentPairTwo = $_GET['studentPairTwo'];
$studentPairThree = $_GET['studentPairThree'];
$studentPairFour = $_GET['studentPairFour'];
$graderPairOne = $_GET['graderPairOne'];
$graderPairTwo = $_GET['graderPairTwo'];
$graderPairThree = $_GET['graderPairThree'];
$graderPairFour = $_GET['graderPairFour'];

$results = array($studentPairOne, $studentPairTwo, $studentPairThree, $studentPairFour, $graderPairOne, $graderPairTwo, $graderPairThree, $graderPairFour);
$names = array("Student Pair One: ","Student Pair Two: ","Student Pair Three: ","Student Pair Four: ","Grader Pair One: ","Grader Pair Two: ","Grader Pair Three: ","Grader Pair Four: ");

for($x = 0; $x < sizeof($results); $x++)
{

	switch($results[$x])
	{
		case 3:
			echo "<span class=''> <font color='#00FF00'>".$names[$x]."Success. </font></span><br/>"; 
			break;
		case 2:
			 echo "<span class=''> <font color='#FF0000'>".$names[$x]."Input does not Match Ouput. </font></span><br/>";
			break;
		case 1:
			 echo "<span class=''> <font color='#FF0000'>".$names[$x]."Compiles but does not run. </font></span><br/>";
			break;
		case 0:
			echo "<span class=''> <font color='#FF0000'>".$names[$x]."Does not compile. </font></span><br/>";
			break;
		case -1:
			break;
	}
}


	

?>